﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Antioch
{
    class ScreenOpeningSplash : Screen
    {
        Texture2D Logo;
        int Ticks = 0;

        public ScreenOpeningSplash()
        {
        }

        public override void Initialize()
        {
            Logo = Content.Load<Texture2D>("Antioch.Content/logo");
        }

        public override void Update(GameTime gameTime)
        {
            ++Ticks;
            if (Ticks >= 120)
            {
                PopScreen();
                PushScreen(new ScreenPressStart());
            }
        }

        public override void Draw()
        {
			GraphicsDevice.Clear(Color.Black);
            //GraphicsDevice.RenderState.AlphaBlendEnable = true;
            //GraphicsDevice.RenderState.SourceBlend = Blend.SourceAlpha;
            //GraphicsDevice.RenderState.DestinationBlend = Blend.InverseSourceAlpha;
            //GraphicsDevice.RenderState.BlendFunction = BlendFunction.Add;


			int ScreenWidth = GraphicsDevice.Viewport.TitleSafeArea.Width;
			int ScreenHeight = GraphicsDevice.Viewport.TitleSafeArea.Height;
			Rectangle SpritePosition = new Rectangle();
			SpritePosition.X = GraphicsDevice.Viewport.TitleSafeArea.X + (ScreenWidth / 2) - (ScreenHeight / 2);
			SpritePosition.Width = ScreenHeight;
			SpritePosition.Y = GraphicsDevice.Viewport.TitleSafeArea.Y;
			SpritePosition.Height = ScreenHeight;

			SpriteBatch.Begin();
			SpriteBatch.Draw(Logo, SpritePosition, Color.White);

			SpriteBatch.End();
        }
    }
}
